package com.bsoft.utils;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

import java.nio.charset.Charset;


/**
 * @author kanmingjin
 * @create 2025-02-07
 */
public class ClientUtil {

  public static String invoke(String url,String service, String parameter) {
    JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
    Object[] objects;
    Client cxfClient = dcf.createClient(url);
    try {
      objects = cxfClient.invoke(service,parameter);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return String.valueOf(objects[0]);
  }



}
